home *** CD-ROM | disk | FTP | other *** search
/ The Essential Home & Business Collection / The Essential Home & Business Collection.iso / 17 / 7 / 3 / 4DOS.ZIP / INSTALL.BTM < prev    next >
Text File  |  1991-04-12  |  15KB  |  316 lines

  1. @echo off
  2. setlocal^unalias *
  3. alias clb `drawbox 0 0 %1 79 0 %tcolor fill %bg`
  4. alias clr clb 23
  5. alias clr2 clb 24
  6. alias box `clr^screen %1 %lcol^drawbox %1 %lcol %2 %rcol 2 %hcolor fill %bg`
  7. alias put `scrput %1 %tcol %tcolor %2`
  8. alias puth `scrput %1 %tcol %hcolor %2`
  9. alias setin `scrput %1 %2 %tcolor %3&^screen %1 %2`
  10. alias inp `setin %1 %2 %3^input %%in`
  11. alias ink `setin %1 %2 %3^inkey %%in`
  12. alias inreq `scrput %1 %tcol %pcolor %2&`
  13. alias keywait `inreq %1 `Press X to exit, any other key to continue ...`^ink %1 %kcol `    `^if "%in"=="X" goto %2`
  14. alias keywait2 `inreq %1 `Press any key to continue ...`^ink %1 %kcol2 `    ``
  15. alias upper `set %1=%@upper[%[%1]]`
  16. alias trunc `set %1=%@upper[%@substr[%[%1],0,1]]`
  17. alias bp beep 659 2
  18. alias ask `bp^echo.^input %& %%in^trunc in`
  19. alias ask1 `inreq %1 %3^inp %1 %2 `    `^trunc in`
  20. alias getdir `set dir=%[%1]^set row=%2^gosub GET_DIR^set %1=%dir >& nul`
  21. alias errclr `scrput 24 0 %tcolor `                                                                           ``
  22. alias error `beep 880 3^scrput 24 %lcol %ecolor %1^goto %2`
  23. alias dirchk `if "%dlook"=="N" dcerr`
  24. alias dcerr `error `You must set the installation directories first` MAINMENU`
  25. alias setdir `cdd %1^if diskfree lt %2 dirfull %3`
  26. alias dirfull `beep 880 3^echo.^echo   There is not enough room on your disk to install these files^goto %1`
  27. iff "%1"=="" then^set sd=A^else^set sd=%1^trunc sd^endiff
  28. iff "%2"=="" then^set td=C^else^set td=%2^trunc td^endiff
  29. set dlook=N^set i286=N^set lcol=4^set rcol=75^set tcol=8^set kcol=55^set kcol2=38
  30. set tcolor=whi on bla^set hcolor=bri whi on bla^set pcolor=bri whi on bla^set ecolor=bri whi on bla^set bg=bla
  31. iff not video==mono then
  32.    iff not monitor==mono then
  33.       set tcolor=whi on blu^set hcolor=bri whi on blu^set pcolor=bri yel on blu^set ecolor=bri red on blu^set bg=blu
  34.    endiff
  35. endiff
  36. iff "%td" GE "C" then
  37.   set udir=\4dos^set ddir=\4dos
  38. else
  39.   set udir=\^set ddir=\
  40. endiff
  41. set sdir=%td:\^set udir=%td:%udir^set ddir=%td:%ddir
  42. color %tcolor^clr^errclr
  43. box 1 24
  44. puth 03 `                          Introduction`
  45. put  05 `Welcome, and thanks for trying 4DOS!`
  46. put  07 `Using a menu system implemented entirely in 4DOS's powerful`
  47. put  08 `batch file language, INSTALL will allow you to:`
  48. put  10 `        * Set the directories for 4DOS files`
  49. put  12 `        * Copy the 4DOS files to your boot disk`
  50. put  14 `        * Create a file containing the changes you need to`
  51. put  15 `          make in CONFIG.SYS to boot your system with 4DOS`
  52. put  17 `        * View and / or print the 4DOS manual and other`
  53. put  18 `          documentation`
  54. put  20 `        * Brand your registered copy of 4DOS`
  55. keywait 22 UEXIT^clr2
  56. box 5 18
  57. puth 07 `              Registered Copy Information`
  58. put  09 `This procedure can be used to install both registered and `
  59. put  10 `shareware copies of 4DOS.`
  60. put  12 `If you have a registered copy of 4DOS, INSTALL will allow you`
  61. put  13 `to run the BRAND program to convert your 4DOS shareware files`
  62. put  14 `into a registered version of the program.`
  63. ask1 16 54 `Do you have a registered copy of 4DOS (Y/N)?`
  64. set reg=%in^iff "%in" NE "Y" then
  65.   box 1 23
  66.   puth 03 `                      Shareware Information`
  67.   put  05 `After installing a shareware copy of 4DOS you may try it`
  68.   put  06 `for up to 21 days before deciding whether you want to`
  69.   put  07 `continue using it and pay the registration fee.  After this`
  70.   put  08 `time you are required to either register 4DOS or stop using it,`
  71.   put  09 `as specified in the 4DOS license agreement.  This method of`
  72.   put  10 `marketing, known as "shareware", allows you to try 4DOS to`
  73.   put  11 `determine whether it meets your needs before you pay for it.  `
  74.   put  13 `For more information on registration and the license agreement,`
  75.   put  14 `see the 4DOS manual, or the files README.DOC and ORDER.FRM.`
  76.   put  16 `You may make copies of the shareware version of 4DOS for others`
  77.   put  17 `to try.  Never copy the registered version of 4DOS for others. `
  78.   put  18 `If you run a shareware disk library, see the VENDOR.DOC file`
  79.   put  19 `for distribution information.`
  80.   keywait 21 UEXIT
  81. endiff
  82. iff "%reg"=="Y" then
  83.   set m_end=22^set m_ask=20^set m_exit=17
  84. else
  85.   set m_end=20^set m_ask=18^set m_exit=15
  86. endiff
  87. :MAINMENU
  88. box 2 %m_end
  89. puth 04 `                         4DOS INSTALL Main Menu`
  90. put  06 `                1 - Set directories for 4DOS files`
  91. put  08 `                2 - Copy the 4DOS files`
  92. put  10 `                3 - View / print the manual and`
  93. put  11 `                    other documentation`
  94. put  13 `                4 - Create CONFIG.SYS modifications`
  95. iff "%reg"=="Y" then
  96.   put  15 `                5 - Brand a registered copy of 4DOS`
  97. endiff
  98. put  %m_exit `                X - Exit INSTALL`
  99. ask1 %m_ask 44 `             Enter your selection:`^set msel=%in^errclr
  100. if "%msel" NE "1" goto NOT1
  101.   box 3 19
  102.   puth 05 `                  Directory Selection Caution`
  103.   put  07 `If you are upgrading from a previous version of 4DOS, be sure`
  104.   put  08 `to install the version 3.03 files in a DIFFERENT directory from`
  105.   put  09 `the one your current 4DOS files are stored in.  After you have`
  106.   put  10 `looked at the documentation and read about the changes in version`
  107.   put  11 `3.03, you can copy the new files to your usual directories, and`
  108.   put  12 `reboot your system with version 3.03 of 4DOS.`
  109.   put  14 `View or print the README.DOC file for more information on`
  110.   put  15 `upgrading from a previous version to version 3.03.`
  111.   keywait 17 MAINMENU
  112.   box 2 23
  113.   puth 04 `                       Directory Selection`
  114.   put  06 `4DOS's system (executable) files normally go in the root`
  115.   put  07 `directory of your boot disk.  Directory for system files:`
  116.   put  09 ``
  117.   put  11 `Utility files normally go in their own directory.  You`
  118.   put  12 `should modify your PATH statement in AUTOEXEC.BAT to`
  119.   put  13 `include this directory.  Directory for utility files:`
  120.   put  15 ``
  121.   put  17 `Documentation files may go in any directory you like.  You`
  122.   put  18 `must select a directory for these files if you want to`
  123.   put  19 `view or print them.  Directory for documentation files:`
  124.   put  21 ``
  125.   getdir sdir 9
  126.   iff %@len[%sdir] GT 3 then^set udir=%sdir^set ddir=%sdir^endiff
  127.   getdir udir 15^getdir ddir 21
  128.   upper sdir^upper udir^upper ddir^set dlook=Y
  129.   goto MAINMENU
  130. :NOT1
  131. if "%msel" NE "2" goto NOT2
  132.   dirchk^set zn=%sd:pkunzip.exe^set tdisk=%@substr[%udir,0,2]
  133.   if "%tdisk"=="A" goto DOCOPY^if "%tdisk"=="B" goto DOCOPY^if %@substr[%_dosver,0,1]==2 goto DOCOPY
  134.   copy %zn %udir\ >&nul^if exist %udir\pkunzip.exe set zn=%udir\pkunzip.exe
  135. :DOCOPY
  136.   cls^echo.^echo.^echo UnZIPping (decompressing) the 4DOS files ...^echo.
  137.   echo If a file already exists, you will be prompted by the unzip program
  138.   echo for whether to overwrite it.
  139.   iff "%3"=="5" then
  140.     iff "%reg"=="Y" then
  141.       echo.^echo --> Your registered copy of 4DOS on 5.25 inch disks has the files
  142.       echo     4DOS286.EXE, SHELL2E.COM, and SHELL2E.DOC stored on the registered disk.
  143.       echo     These files will not be installed now.  Instead, they will be installed
  144.       echo     when you are BRANDing your copy of 4DOS.
  145.       echo.^bp^set reg5=Y
  146.     endiff
  147.   endiff
  148.   echo.
  149.   echo If you are installing 4DOS on a floppy disk system, you may change
  150.   echo disks at any of the "(Y/N)" prompts during the copying process.
  151.   echo.
  152.   ask Install the system files in %sdir (Y/N)?
  153.   if "%in" NE "Y" goto SKIPSYS
  154.     set isys=Y^setdir %sdir 80K SKIPSYS
  155.     %zn %sd:4dos 4dos.com keystack.sys
  156.     iff "%_cpu"=="86" then^%zn %sd:4dos 4dos88.exe
  157.     elseiff "%3"=="3" then^%zn %sd:4dos 4dos286.exe
  158.     else %zn %sd:4dos 4dos88.exe
  159.     endiff
  160. :SKIPSYS
  161.   ask Install the utility files in %udir (Y/N)?
  162.   if "%in" NE "Y" goto SKIPUTIL
  163.     set iutl=Y^setdir %udir 155K SKIPUTIL
  164.     %zn %sd:4dos dos.hlp help.exe helpcfg.exe aliases
  165.     %zn %sd:4dos 4dos.ico 4dosm.ico 4dos.pif
  166.     if "%3"=="3" %zn %sd:4dos shell2e.com
  167. :SKIPUTIL
  168.   ask Install the 4DOS manual in %ddir (Y/N)?
  169.   if "%in" NE "Y" goto SKIPMAN
  170.     setdir %ddir 340K SKIPMAN
  171.     %zn %sd:4dos 4dos.doc
  172. :SKIPMAN
  173.   ask Install the other documentation files in %ddir (Y/N)?
  174.   if "%in" NE "Y" goto SKIPDOC
  175.     setdir %ddir 175K SKIPDOC
  176.     %zn %sd:4dos readme.doc update30.doc compat.doc
  177.     %zn %sd:4dos order.frm support.bbs sysop.doc vendor.doc
  178.     if "%3"=="3" %zn %sd:4dos shell2e.doc
  179. :SKIPDOC
  180.   echo.^pause Copying complete, press any key to return to menu ...
  181.   goto MAINMENU
  182. :NOT2
  183. if "%msel" NE "3" goto NOT3
  184.   dirchk^cdd %ddir^if exist *.doc goto VIEW
  185.   if not exist *.doc error `No documentation files are available` MAINMENU
  186.   :VIEW
  187.   box 1 23
  188.   puth 03 `               View / Print the Documentation Files`
  189.   put  05 `INSTALL will now use the 4DOS SELECT command to display a`
  190.   put  06 `list of the available documentation files.  If you installed`
  191.   put  07 `the documentation files on a floppy disk be sure it is in the`
  192.   put  08 `drive now.`
  193.   put  10 `When you see the list of documentation files, use the up and`
  194.   put  11 `down arrow keys to move between the files, and the space bar`
  195.   put  12 `to toggle whether a file is selected.  When you are ready to`
  196.   put  13 `view the selected files, press the Enter (─┘) key.`
  197.   put  15 `While viewing a file, press Esc to go on to the next file, or`
  198.   put  16 `Ctrl-C to terminate file viewing.  Press "P" to print the file,`
  199.   put  17 `"F" to search for a topic, and "N" to continue the search.  Be`
  200.   put  18 `sure the printer is set up and the paper is aligned at the top`
  201.   put  19 `of a page before you start printing.`
  202.   keywait 21 MAINMENU
  203.   select list [*.doc+*.frm]
  204.   goto MAINMENU
  205. :NOT3
  206. if "%msel" NE "4" goto NOT4
  207.   dirchk^cdd %sdir
  208.   box 2 23
  209.   puth 04 `                 Set up CONFIG.SYS Modifications`
  210.   put  06 `INSTALL will now create a file called CONFIG.4D which will`
  211.   put  07 `contain two lines to be placed in your CONFIG.SYS file in`
  212.   put  08 `order to boot your system with 4DOS.  You must copy these`
  213.   put  09 `lines to CONFIG.SYS yourself with an editor or any other`
  214.   put  10 `method you choose.  INSTALL will not modify your CONFIG.SYS`
  215.   put  11 `file.`
  216.   put  13 `The CONFIG.4D file will be created in the directory you`
  217.   put  14 `specified for your 4DOS system files, and will be displayed`
  218.   put  15 `on screen after it has been created.`
  219.   put  17 `If you already have a CONFIG.4D file, it will be deleted.`
  220.   put  18 `If you don't want it deleted, use X at the prompt below to`
  221.   put  19 `return to the main menu`
  222.   keywait 21 MAINMENU
  223.   set load=^if "%sdir"=="A:\" goto LOADOK^if "%sdir"=="C:\" goto LOADOK
  224.   set load=/L:%sdir
  225. :LOADOK
  226.   echo DEVICE=%@upper[%_cwds]KEYSTACK.SYS >! config.4D
  227.   echo SHELL=%@upper[%_cwds]4DOS.COM %load /p >>! config.4D
  228.   cls^echo.^echo.^echo CONFIG.4D:^echo.^type config.4d^echo.
  229.   pause Press any key to return to the main menu ...
  230.   goto MAINMENU
  231. :NOT4
  232. if "%msel" NE "5" goto NOT5^if "%reg" NE "Y" goto NOT5
  233.   dirchk^cdd %sdir^clr^box 1 23
  234.   puth 03 `              BRAND a Registered Copy of 4DOS`
  235.   put  05 `INSTALL will now allow you to brand your copy of 4DOS.  The`
  236.   put  06 `branding procedure converts the shareware copy you just`
  237.   put  07 `installed to a registered copy.  This method allows you to`
  238.   put  08 `download later releases of 4DOS (e.g. a maintenance release,`
  239.   put  09 `or your free upgrade) and brand them yourself, rather than`
  240.   put  10 `having to obtain them on diskette from J.P. Software.`
  241.   put  12 `If you do not have a registered copy of 4DOS, you cannot use`
  242.   put  13 `this option.  Press X at the prompt below to return to the menu.`
  243.   put  15 `Depending on your system configuration, INSTALL may only copy`
  244.   put  16 `one of the 4DOS executable files (4DOS88.EXE or 4DOS286.EXE).`
  245.   put  17 `The BRAND program will attempt to brand both files, and may`
  246.   put  18 `therefore issue an error message indicating that it couldn't`
  247.   put  19 `find one of the files.  You can ignore this message.`
  248.   keywait 21 MAINMENU
  249. :TRYBRAND
  250.   cls^echo.^echo.^echo Record the serial number from the label on your registered 4DOS disk
  251.   echo so that you can enter it when the BRAND program prompts you for it.
  252.   echo.^echo If you are upgrading a copy of an earlier version of 4DOS, use the registered
  253.   echo disk that came with that version.
  254. :TRYBDISK
  255.   set dname=registered^set dfile=brand.exe^set dskip=Y^gosub GETDISK
  256.   if "%diskok"=="N" goto BRDONE^if "%diskok"=="W" goto TRYBDISK
  257.   if "%reg5" NE "Y" goto DOBRAND
  258.   if "%isys" NE "Y" goto REGUTL
  259.   echo.^echo Installing 4DOS286 from registered disk to %sdir
  260.   setdir %sdir 65K REGUTL
  261.   %sd:pkunzip %sd:4dos2 4dos286.exe
  262. :REGUTL
  263.   if "%iutl" NE "Y" goto DOBRAND
  264.   echo.^echo Installing SHELL2E from registered disk to %udir
  265.   if not isdir %udir md %udir >& nul
  266.   setdir %udir 6K DOBRAND
  267.   %sd:pkunzip %sd:4dos2 shell2e.com shell2e.doc
  268. :DOBRAND
  269.   %sd:brand.exe^echo.
  270. :BRDONE
  271.   gosub SHRDISK^goto MAINMENU
  272. :NOT5
  273. if "%msel" NE "X" goto MAINMENU
  274. :DONE
  275. box 4 21
  276. puth 06 `                   Installation Completed`
  277. put  08 `Installation is complete.  In order to boot your system`
  278. put  09 `with 4DOS, be sure to modify your CONFIG.SYS file to`
  279. put  10 `include the lines created by INSTALL in CONFIG.4D.  You`
  280. put  11 `may want to read the section of the manual on installation`
  281. put  12 `options to see if you prefer options other than the defaults`
  282. put  13 `set by INSTALL.`
  283. put  15 `If you are upgrading from a previous version of 4DOS be sure`
  284. put  16 `to read UPDATE30.DOC and the upgrade information in README.DOC`
  285. put  17 `before using this new version.`
  286. keywait2 19^clr^screen 23 0^quit
  287. :UEXIT
  288. clr2^screen 23 0 Exiting INSTALL per your requestrn^pause^quit
  289.  
  290. :GET_DIR
  291. set olddir=%dir
  292. :RETRY
  293. setin %row 11 `                                                  `
  294. if "%dir"=="" set dir=%olddir
  295. eset dir^errclr^if "%@substr[%dir,1,1]"==":" goto DRVOK
  296. error `The drive letter must be specified -- please try again` RETRY
  297. :DRVOK
  298. if isdir %dir return
  299. md %dir >& nul^if isdir %dir return
  300. error `Invalid directory -- please try again` RETRY
  301.  
  302. :SHRDISK
  303. set dname=shareware^set dfile=4dos.zip^set dskip=N^gosub GETDISK
  304. if "%diskok" NE "Y" goto SHRDISK^return
  305.  
  306. :GETDISK
  307. set diskok=N^echo.^echo Place the %dname disk in drive %sd:
  308. set dmsg=Press any key to continue
  309. if "%dskip"=="Y" set dmsg=Press X to skip this step, or any other key to continue
  310. bp^inkey %dmsg ... %%in^if "%dskip"=="Y" if "%in"=="X" return
  311. if exist %sd:%dfile goto GOTDISK
  312. beep 880 3^echo.^echo Wrong disk -- try again^set diskok=W^return
  313. :GOTDISK
  314. set diskok=Y^return
  315.  
  316.